package com.video.tiktokdownloader.nowatermark

import android.os.Environment
import com.alibaba.fastjson.JSON
import com.video.tiktokdownloader.nowatermark.bean.MediaEntity
import com.zhouyou.http.EasyHttp
import com.zhouyou.http.callback.DownloadProgressCallBack
import com.zhouyou.http.exception.ApiException
import com.zhouyou.http.utils.HttpLog
import java.io.File
import java.util.regex.Pattern


/**
 * @author Afra55
 * @date 2020/6/24
 * A smile is the best business card.
 * 没有成绩，连呼吸都是错的。
 * 为了区别以往的代码习惯，以下代码有手动混淆的嫌疑
 *
 */
val Referer = "https://www.tiktok.com/trending?lang=en"
fun BaseActivity.getVideoDir(share: Boolean = false): String {
    if (share) {
        return if (Environment.MEDIA_MOUNTED == Environment.getExternalStorageState()) {
            try {
                val externalMediaDirs = this.externalMediaDirs
                val dir = externalMediaDirs[0]
                val dirFile = File(dir, "video")
                if (!dirFile.exists()) {
                    dirFile.mkdirs()
                }
                dirFile.absolutePath
            } catch (e: Exception) {
                this.cacheDir.absolutePath
            }
        } else this.cacheDir.absolutePath
    } else {
        return this.filesDir.absolutePath
    }
}

fun BaseActivity.getMusicDir(share: Boolean = false): String {
    if (share) {
        return if (Environment.MEDIA_MOUNTED == Environment.getExternalStorageState()) {
            try {
                val externalMediaDirs = this.externalMediaDirs
                val dir = externalMediaDirs[0]
                val dirFile = File(dir, "music")
                if (!dirFile.exists()) {
                    dirFile.mkdirs()
                }
                dirFile.absolutePath
            } catch (e: Exception) {
                this.cacheDir.absolutePath
            }
        } else this.cacheDir.absolutePath
    } else {
        return this.filesDir.absolutePath
    }
}

//  EasyHttp.get("/misc/sx?product_id=com.biligg.xreports&version=1.0.1")
//            .baseUrl("https://xreport.followtracker.info")
//            .headers("user-agent", User_Agent)
//            .execute(StringCallBack.getCallBack(this, {
//                Log.i("t", it)
//            }, {
//
//            }))
interface Listener{
    /**
     * 1: cover
     * 2: download
     */
    fun onView(type:Int, any:Any?)
}
class ApiPresenter(val baseActivity: BaseActivity,val listener: Listener) {

    fun doAction(url: String, want: Int) {

        if (url.startsWith("https://vm.tiktok.com")) {

            baseActivity.showMarker()
            EasyHttp.get(url)
                .headers("User-Agent", BaseActivity.User_Agent)
                .headers("Referer",Referer)
                .execute(StringCallBack.getCallBack(baseActivity, {
                    try {
                        var needDismissMarker = true
                        if (!it.isNullOrEmpty()) {
                            val pattern =
                                Pattern.compile("href=\"(https://www.tiktok.com/@[^\"]+)\"")
                            val matcher = pattern.matcher(it)

                            if (matcher.find()) {
                                val linkUrl = (matcher.group(1))
                                if (!linkUrl.isNullOrEmpty()) {
                                    needDismissMarker = false
                                    touchLinkUrl(linkUrl, want)
                                }

                            }
                        }
                        if (needDismissMarker) {
                            baseActivity.dismissMarker()
                        }
                    } catch (e: Exception) {
                        baseActivity.dismissMarker()
                    }
                }, {
                    baseActivity.dismissMarker()
                    baseActivity.showToast("Error!")
                }))

        } else if (url.startsWith("https://www.tiktok.com/@") && url.contains("video")) {
            baseActivity.showMarker()
            touchLinkUrl(url, want)

        } else {
            baseActivity.showToast("Unsupported link")
        }
    }

    private fun touchLinkUrl(linkUrl: String, want: Int) {
        val shareNodeUrl =
            "https://www.tiktok.com/node/share/video/" + linkUrl.substring(
                linkUrl.indexOf("@")
            ).replace(
                "/video",
                ""
            )
        nodeShare(shareNodeUrl, want, linkUrl)
    }

    private fun nodeShare(shareNodeUrl: String, want: Int, linkUrl: String) {
//        baseActivity.showMarker()
        EasyHttp.get(shareNodeUrl)
            .headers("User-Agent", BaseActivity.User_Agent)
            .headers("Referer",Referer)
            .execute(
                StringCallBack.getCallBack(
                    baseActivity,
                    { shareIt ->


                        try {
                            if (!shareIt.isNullOrEmpty()) {
                                var needDimissMarker = true

                                val json = JSON.parseObject(shareIt.replace("@", ""))
                                if (json != null) {
                                    val body = json.getJSONObject("body")

                                    if (want == 0) {
                                        // video

                                        val videoData =
                                            body.getJSONObject("videoData")
                                        val itemInfos =
                                            videoData.getJSONObject("itemInfos")
                                        val mediaId =
                                            itemInfos.getString("id")
                                        val video =
                                            itemInfos.getJSONObject("video")
                                        val urls =
                                            video.getJSONArray("urls")
                                        val videoUrl = urls.getString(0)
                                        val covers =
                                            itemInfos.getJSONArray("covers")
                                        val coverUrl = covers.getString(0)
                                        val text =
                                            itemInfos.getString("text")
                                        val createTime =
                                            itemInfos.getString("createTime")
                                        val authorInfos =
                                            videoData.getJSONObject("authorInfos")
                                        val uniqueId =
                                            authorInfos.getString("uniqueId")
                                        val userId =
                                            authorInfos.getString("userId")
                                        //                                                        val nickName = authorInfos.getString("nickName")
                                        val avatarUrl =
                                            authorInfos.getJSONArray("covers")
                                                .getString(0)
                                        val mediaEntity =
                                            MediaEntity("v$mediaId", 0)
                                        mediaEntity.userName = uniqueId
                                        mediaEntity.userCover = avatarUrl
                                        mediaEntity.cover = coverUrl
                                        mediaEntity.createTime = createTime
                                        mediaEntity.desc = text
                                        mediaEntity.downloadUrl = videoUrl
                                        mediaEntity.fileName =
                                            "${mediaEntity.id}.mp4"
                                        mediaEntity.userId = userId
                                        mediaEntity.originUrl = linkUrl

                                        AppApplication.dao.insertAll(
                                            mediaEntity
                                        )

                                        listener.onView(1, mediaEntity)



                                        baseActivity.showInterstitial(1)

//                                        baseActivity.showMarker()
                                        needDimissMarker = false
                                        EasyHttp.get(mediaEntity.downloadUrl)
                                            .headers(
                                                "User-Agent",
                                                BaseActivity.User_Agent
                                            )
                                            .headers("Referer",Referer)
                                            .execute(
                                                StringCallBack.getCallBack(
                                                    baseActivity,
                                                    { vIt ->
                                                        var disMarker1 = true
                                                        if (!vIt.isNullOrEmpty()) {
                                                            var vid: String? =
                                                                null
                                                            val indexOf =
                                                                vIt.indexOf(
                                                                    "vid:"
                                                                )
                                                            if (indexOf > 0) {
                                                                vid =
                                                                    vIt.substring(
                                                                        indexOf + 4,
                                                                        indexOf + 36
                                                                    )
                                                            }
//                                                            baseActivity.showMarker()
                                                            disMarker1 = false
                                                            if (vid.isNullOrEmpty()) {
                                                                EasyHttp.downLoad(
                                                                    mediaEntity.downloadUrl
                                                                )
                                                                    .headers(
                                                                        "User-Agent",
                                                                        BaseActivity.User_Agent
                                                                    )
                                                                    .headers("Referer",Referer)
                                                                    .savePath(
                                                                        baseActivity.getVideoDir()
                                                                    )
                                                                    .saveName(
                                                                        mediaEntity.fileName
                                                                    )
                                                                    .execute(
                                                                        object :
                                                                            DownloadProgressCallBack<String>() {
                                                                            override fun update(
                                                                                bytesRead: Long,
                                                                                contentLength: Long,
                                                                                done: Boolean
                                                                            ) {
                                                                                if (contentLength > 0) {
                                                                                    if (done) { //下载完成
                                                                                        baseActivity.showMarker(
                                                                                            "Download succeeded"
                                                                                        )
                                                                                    } else {
                                                                                        val progress =
                                                                                            (bytesRead * 100 / contentLength).toInt()
                                                                                        baseActivity.showMarker(
                                                                                            progress.toString()
                                                                                        )
                                                                                    }
                                                                                } else {
                                                                                    baseActivity.dismissMarker()
                                                                                    baseActivity.showToast(
                                                                                        "Error!"
                                                                                    )
                                                                                }
                                                                            }

                                                                            override fun onComplete(
                                                                                path: String?
                                                                            ) {
                                                                                //下载完成，path：下载文件保存的完整路径
                                                                                baseActivity.dismissMarker()
                                                                                baseActivity.showToast(
                                                                                    "Download succeeded"
                                                                                )
                                                                            }

                                                                            override fun onError(
                                                                                e: ApiException?
                                                                            ) {
                                                                                baseActivity.dismissMarker()
                                                                                baseActivity.showToast(
                                                                                    "Error!"
                                                                                )
                                                                            }

                                                                            override fun onStart() {
                                                                                baseActivity.showMarker(
                                                                                    "Start downloading"
                                                                                )
                                                                            }

                                                                        }
                                                                    )

                                                            } else {
                                                                EasyHttp.downLoad(
                                                                    "https://api2-16-h2.musical.ly/aweme/v1/play/?video_id=$vid&vr_type=0&is_play_url=1&source=PackSourceEnum_PUBLISH&media_type=4&improve_bitrate=1&ratio=580p"
                                                                )
                                                                    .headers(
                                                                        "User-Agent",
                                                                        "okhttp"
                                                                    )
                                                                    .headers("Referer",Referer)
                                                                    .savePath(
                                                                        baseActivity.getVideoDir()
                                                                    )
                                                                    .saveName(
                                                                        mediaEntity.fileName
                                                                    )
                                                                    .execute(
                                                                        object :
                                                                            DownloadProgressCallBack<String>() {
                                                                            override fun update(
                                                                                bytesRead: Long,
                                                                                contentLength: Long,
                                                                                done: Boolean
                                                                            ) {
                                                                                if (contentLength > 0) {
                                                                                    if (done) { //下载完成
                                                                                        baseActivity.showMarker(
                                                                                            "Download succeeded"
                                                                                        )
                                                                                    } else {
                                                                                        val progress =
                                                                                            (bytesRead * 100 / contentLength).toInt()
                                                                                        baseActivity.showMarker(
                                                                                            progress.toString()
                                                                                        )
                                                                                    }
                                                                                } else {
                                                                                    baseActivity.dismissMarker()
                                                                                    baseActivity.showToast(
                                                                                        "Error!"
                                                                                    )
                                                                                }
                                                                            }

                                                                            override fun onComplete(
                                                                                path: String?
                                                                            ) {
                                                                                //下载完成，path：下载文件保存的完整路径
                                                                                baseActivity.dismissMarker()
                                                                                baseActivity.showToast(
                                                                                    "Download succeeded"
                                                                                )
                                                                            }

                                                                            override fun onError(
                                                                                e: ApiException?
                                                                            ) {
                                                                                baseActivity.dismissMarker()
                                                                                baseActivity.showToast(
                                                                                    "Error!"
                                                                                )
                                                                            }

                                                                            override fun onStart() {
                                                                                baseActivity.showMarker(
                                                                                    "Start downloading"
                                                                                )
                                                                            }

                                                                        }
                                                                    )

                                                            }
                                                        }
                                                        if (disMarker1) {
                                                            baseActivity.dismissMarker()
                                                            baseActivity.showToast(
                                                                "Error"
                                                            )
                                                        }
                                                    },
                                                    {
                                                        baseActivity.dismissMarker()
                                                        baseActivity.showToast(
                                                            "Error"
                                                        )
                                                    })
                                            )

                                    } else if (want == 1) {
                                        // music
                                        val videoData =
                                            body.getJSONObject("videoData")
                                        val musicInfos =
                                            videoData.getJSONObject("musicInfos")
                                        val musicId =
                                            musicInfos.getString("musicId")
                                        val musicName =
                                            musicInfos.getString("musicName")
                                        val musicCover = try {
                                            musicInfos.getJSONArray("covers")
                                                .getString(0)
                                        } catch (e: Exception) {
                                            null
                                        }
                                        val mediaEntity = MediaEntity("m$musicId", 1)
                                        mediaEntity.cover = musicCover
                                        mediaEntity.name = musicName
                                        mediaEntity.fileName =
                                            musicName.replace(" ", "_") + "_" + musicId + ".mp3"

                                        val musicShareUrl =
                                            "https://www.tiktok.com/node/share/music/${(mediaEntity.name?.replace(
                                                "&",
                                                ""
                                            )?.replace("#", "")?.replace(
                                                "  ",
                                                " "
                                            )?.trim()?.replace(
                                                " ",
                                                "-"
                                            ) + "-" + musicId).replace("---", "-")}"
//                                        baseActivity.showMarker()
                                        needDimissMarker = false
                                        EasyHttp.get(musicShareUrl)
                                            .headers("Referer",Referer)
                                            .headers(
                                                "User-Agent",
                                                BaseActivity.User_Agent
                                            ).execute(
                                                StringCallBack.getCallBack(
                                                    baseActivity,
                                                    { musicResponse ->
                                                        var dismissMarkder2 = true
                                                        if (!musicResponse.isNullOrEmpty()) {
                                                            val jb = JSON.parseObject(musicResponse)
                                                            if (jb != null) {
                                                                val body = jb.getJSONObject("body")
                                                                val musicData =
                                                                    body.getJSONObject("musicData")
                                                                val playUrl =
                                                                    musicData.getJSONObject("playUrl")
                                                                        .getJSONArray("UrlList")
                                                                        .getString(0)
                                                                var coversMedium = try {
                                                                    musicData.getJSONArray("coversMedium")
                                                                        .getString(0)
                                                                } catch (e: Exception) {
                                                                    null
                                                                }
                                                                coversMedium = try {
                                                                    if (coversMedium == null) {
                                                                        musicData.getJSONArray(
                                                                            "covers"
                                                                        ).getString(
                                                                            0
                                                                        )
                                                                    } else {
                                                                        mediaEntity.cover
                                                                    }
                                                                } catch (e: Exception) {
                                                                    mediaEntity.cover
                                                                }

                                                                mediaEntity.downloadUrl = playUrl
                                                                mediaEntity.cover = coversMedium
                                                                mediaEntity.originUrl = linkUrl
                                                                AppApplication.dao.insertAll(
                                                                    mediaEntity
                                                                )
                                                                listener.onView(1, mediaEntity)
//                                                                baseActivity.showMarker()
                                                                dismissMarkder2 = false
                                                                EasyHttp.downLoad(
                                                                    playUrl
                                                                )
                                                                    .headers("Referer",Referer)
                                                                    .headers(
                                                                        "User-Agent",
                                                                        BaseActivity.User_Agent
                                                                    )
                                                                    .savePath(
                                                                        baseActivity.getMusicDir()
                                                                    )
                                                                    .saveName(
                                                                        mediaEntity.fileName
                                                                    )
                                                                    .execute(
                                                                        object :
                                                                            DownloadProgressCallBack<String>() {
                                                                            override fun update(
                                                                                bytesRead: Long,
                                                                                contentLength: Long,
                                                                                done: Boolean
                                                                            ) {
                                                                                if (contentLength > 0) {
                                                                                    if (done) { //下载完成
                                                                                        baseActivity.showMarker(
                                                                                            "Download succeeded"
                                                                                        )
                                                                                    } else {
                                                                                        val progress =
                                                                                            (bytesRead * 100 / contentLength).toInt()
                                                                                        baseActivity.showMarker(
                                                                                            progress.toString()
                                                                                        )
                                                                                    }
                                                                                } else {
                                                                                    baseActivity.dismissMarker()
                                                                                    baseActivity.showToast(
                                                                                        "Error!"
                                                                                    )
                                                                                }
                                                                            }

                                                                            override fun onComplete(
                                                                                path: String?
                                                                            ) {
                                                                                //下载完成，path：下载文件保存的完整路径
                                                                                baseActivity.dismissMarker()
                                                                                baseActivity.showToast(
                                                                                    "Download succeeded"
                                                                                )
                                                                            }

                                                                            override fun onError(
                                                                                e: ApiException?
                                                                            ) {
                                                                                baseActivity.dismissMarker()
                                                                                baseActivity.showToast(
                                                                                    "Error!"
                                                                                )
                                                                            }

                                                                            override fun onStart() {
                                                                                baseActivity.showMarker(
                                                                                    "Start downloading"
                                                                                )
                                                                            }

                                                                        }
                                                                    )


                                                            }
                                                        }
                                                        if (dismissMarkder2) {
                                                            baseActivity.dismissMarker()
                                                            baseActivity.showToast("Not Support!")
                                                        }
                                                    },
                                                    {
                                                        baseActivity.dismissMarker()
                                                        baseActivity.showToast("Not Support!")
                                                    })
                                            )
                                    }
                                    if (needDimissMarker) {
                                        baseActivity.dismissMarker()
                                        baseActivity.showToast("Not Support!")
                                    }

                                }
                            } else {
                                baseActivity.dismissMarker()
                                baseActivity.showToast("Not Support!")
                            }
                        } catch (e: Exception) {
                            // {"body":{"pageState":{"regionAppId":1180,"os":"ios","region":"HK","baseURL":"www.tiktok.com","appType":"t","fullUrl":"https://www.tiktok.com/node/share/video/@loca.chelsey/6815724666934676742"},"videoData":{"itemInfos":{"id":"6815724666934676742","video":{"urls":["https://v19.tiktokcdn.com/f562fdb30b327cc9ea3ff73a459f0810/5efce7b3/video/tos/useast2a/tos-useast2a-ve-0068c001/966f0b61af614906b898ad8ec2a47919/?a=1233&br=2294&bt=1147&cr=0&cs=0&dr=0&ds=3&er=&l=202007011344360101150040691420C927&lr=tiktok_m&mime_type=video_mp4&qs=0&rc=MzRwaHk1bng4dDMzaTczM0ApNDw8NzdmZmU6NzQ3aGgzNWcybS9tZDMuL19fLS0xMTZzc18tNGAuYDIwYWFfX18yNl46Yw%3D%3D&vl=&vr="],"videoMeta":{"width":576,"height":1024,"ratio":15,"duration":15}},"covers":["https://p16-tiktok-va.ibyteimg.com/obj/tos-maliva-p-0068/040a3fa0a56942e6885cc8b6839626fc_1586909566?x-expires=1593781200&x-signature=v945%2BnKj3MDYZ2DiwRj30VMPnp0%3D"],"authorId":"6559895610408796165","coversOrigin":["https://p16-tiktok-va.ibyteimg.com/obj/tos-maliva-p-0068/74f03428c3844680be9cbed004fde21b_1586909566?x-expires=1593781200&x-signature=9l4PlgZPF4PJy8Ya1g9KHg%2FRpmI%3D"],"shareCover":["","https://p16-tiktok-va.ibyteimg.com/tos-maliva-p-0068/74f03428c3844680be9cbed004fde21b_1586909566~tplv-tiktok-play.jpeg?x-expires=1593781200&x-signature=%2BQ8GN8YkNIUNJNmTfsVAjIlWQn0%3D","https://p16-tiktok-va.ibyteimg.com/tos-maliva-p-0068/74f03428c3844680be9cbed004fde21b_1586909566~tplv-tiktok-play2.jpeg?x-expires=1593781200&x-signature=hDeGbwtgsuNfK5NO8igX1DxYFjo%3D"],"text":"2016 musically vibez right here #foryou #keepingbusy #bellydance","commentCount":148,"diggCount":16700,"playCount":197400,"shareCount":352,"createTime":"1586909562","isActivityItem":false,"warnInfo":[],"liked":false,"commentStatus":0,"showNotPass":false},"authorInfos":{"verified":false,"secUid":"MS4wLjABAAAAvfnjrqy0S7_2wCLavffSdqeSwsE1dmiFPMcg6NRdQRi3bQ90xa9ipM8ctIjFlVfR","uniqueId":"loca.chelsey","userId":"6559895610408796165","nickName":"ℓσ¢α ¢нєℓѕєу","covers":["https://p16-va.tiktokcdn.com/img/musically-maliva-obj/6efe34a59d5bd5f6fcd2292bc9419009~c5_100x100.jpeg"],"relation":-1},"musicInfos":{"musicId":"6813750732177574662","musicName":"Originalton","authorName":"enyadres","covers":["https://p16-va.tiktokcdn.com/img/musically-maliva-obj/1664978589275142~c5_100x100.jpeg"]},"authorStats":{"followerCount":98500,"heartCount":"2000000"},"challengeInfoList":[{"challengeId":"42164","challengeName":"foryou"},{"challengeId":"16382352","challengeName":"keepingbusy"},{"challengeId":"2055","challengeName":"bellydance"}],"duetInfo":"0","textExtra":[{"AwemeId":"","Start":32,"End":39,"HashtagName":"foryou","HashtagId":"","Type":1,"UserId":"","IsCommerce":false},{"AwemeId":"","Start":40,"End":52,"HashtagName":"keepingbusy","HashtagId":"","Type":1,"UserId":"","IsCommerce":false},{"AwemeId":"","Start":53,"End":64,"HashtagName":"bellydance","HashtagId":"","Type":1,"UserId":"","IsCommerce":false}],"stickerTextList":[]},"shareUser":{"secUid":"","userId":"","uniqueId":"","nickName":"","signature":"","covers":[],"coversMedium":[],"coversLarger":[],"isSecret":false,"relation":-1},"shareMeta":{"title":"ℓσ¢α ¢нєℓѕєу on TikTok","desc":"2016 musically vibez right here #foryou #keepingbusy #bellydance","image":{"url":"https://p16-tiktok-va.ibyteimg.com/tos-maliva-p-0068/74f03428c3844680be9cbed004fde21b_1586909566~tplv-tiktok-play2.jpeg?x-expires=1593781200&x-signature=hDeGbwtgsuNfK5NO8igX1DxYFjo%3D","width":576,"height":1024}},"statusCode":0,"langList":[{"value":"id","alias":"id-ID","label":"Bahasa Indonesia","children":[{"value":"default","label":""}]},{"value":"de","alias":"de-DE","label":"Deutsch","children":[{"value":"default","label":""}]},{"value":"en","alias":"en","label":"English","children":[{"value":"default","label":""}]},{"value":"es","alias":"es","label":"Español","children":[{"value":"default","label":""}]},{"value":"fr","alias":"fr","label":"Français","children":[{"value":"default","label":""}]},{"value":"it","alias":"it-IT","label":"Italiano","children":[{"value":"default","label":""}]},{"value":"pl","alias":"pl-PL","label":"Polski","children":[{"value":"default","label":""}]},{"value":"pt_BR","alias":"pt-BR","label":"Português","children":[{"value":"default","label":""}]},{"value":"vi","alias":"vi-VN","label":"Tiếng Việt","children":[{"value":"default","label":""}]},{"value":"tr","alias":"tr-TR","label":"Türkçe","children":[{"value":"default","label":""}]},{"value":"ru","alias":"ru-RU","label":"Русский","children":[{"value":"default","label":""}]},{"value":"hi","alias":"hi-IN","label":"हिन्दी","children":[{"value":"default","label":""}]},{"value":"ko","alias":"ko-KR","label":"한국어","children":[{"value":"default","label":""}]},{"value":"ja","alias":"ja-JP","label":"日本語","children":[{"value":"default","label":""}]},{"value":"zh_Hant","alias":"zh-Hant-TW","label":"繁體中文","children":[{"value":"default","label":""}]},{"value":"ar","alias":"ar","label":"العربية","children":[{"value":"default","label":""}]}],"webId":"6844507433189819905","requestId":"42435791593611076289","metaParams":{"robotsContent":"index, follow","title":"2016 musically vibez right here #foryou #keepingbusy #bellydance","keywords":"loca.chelsey, ℓσ¢α ¢нєℓѕєу, TikTok, ティックトック, tik tok, tick tock, tic tok, tic toc, tictok, тик ток, ticktock,foryou,keepingbusy,bellydance","description":"ℓσ¢α ¢нєℓѕєу (@loca.chelsey) has created a short video on TikTok with music Originalton. 2016 musically vibez right here #foryou #keepingbusy #bellydance","canonicalHref":"https://www.tiktok.com/@loca.chelsey/video/6815724666934676742?lang=en","alternateHref":null,"amphtmlHref":null,"applicableDevice":"pc, mobile"},"videoObjectPageProps":{"videoProps":{"url":"https://www.tiktok.com/@loca.chelsey/video/6815724666934676742","name":"2016 musically vibez right here #foryou #keepingbusy #bellydance","description":"ℓσ¢α ¢нєℓѕєу (@loca.chelsey) has created a short video on TikTok with music Originalton. 2016 musically vibez right here #foryou #keepingbusy #bellydance","keywords":"loca.chelsey, ℓσ¢α ¢нєℓѕєу, TikTok, ティックトック, tik tok, tick tock, tic tok, tic toc, tictok, тик ток, ticktock,foryou,keepingbusy,bellydance","thumbnailUrl":["https://www.tiktok.com/api/img/?itemId=6815724666934676742&location=0","https://www.tiktok.com/api/img/?itemId=6815724666934676742&location=1"],"uploadDate":"2020-04-15T00:12:42.000Z","contentUrl":"https://v19.tiktokcdn.com/f562fdb30b327cc9ea3ff73a459f0810/5efce7b3/video/tos/useast2a/tos-useast2a-ve-0068c001/966f0b61af614906b898ad8ec2a47919/?a=1233&br=2294&bt=1147&cr=0&cs=0&dr=0&ds=3&er=&l=202007011344360101150040691420C927&lr=tiktok_m&mime_type=video_mp4&qs=0&rc=MzRwaHk1bng4dDMzaTczM0ApNDw8NzdmZmU6NzQ3aGgzNWcybS9tZDMuL19fLS0xMTZzc18tNGAuYDIwYWFfX18yNl46Yw%3D%3D&vl=&vr=","embedUrl":"https://www.tiktok.com/embed/v2/6815724666934676742","commentCount":"148","duration":"PT15S","audio":{"name":"Originalton - enyadres","author":"enyadres","mainEntityOfPage":{"@type":"ItemPage","@id":"https://www.tiktok.com/music/Originalton-6813750732177574662"}},"creator":{"@type":"Person","name":"ℓσ¢α ¢нєℓѕєу","alternateName":"loca.chelsey","url":"https://www.tiktok.com/@loca.chelsey","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"http://schema.org/LikeAction"},"userInteractionCount":"2000000"},{"@type":"InteractionCounter","interactionType":{"@type":"http://schema.org/FollowAction"},"userInteractionCount":98500}]},"width":576,"height":1024,"interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"http://schema.org/WatchAction"},"userInteractionCount":197400},{"@type":"InteractionCounter","interactionType":{"@type":"http://schema.org/LikeAction"},"userInteractionCount":16700},{"@type":"InteractionCounter","interactionType":{"@type":"http://schema.org/ShareAction"},"userInteractionCount":352}]},"pageProps":{"type":"ItemPage","id":"https://www.tiktok.com/@loca.chelsey/video/6815724666934676742"},"breadcrumbProps":{"urlList":[{"name":"TikTok","url":"https://www.tiktok.com"},{"name":"ℓσ¢α ¢нєℓѕєу (@loca.chelsey) | TikTok","url":"https://www.tiktok.com/@loca.chelsey"},{"name":"2016 musically vibez right here #foryou #keepingbusy #bellydance","url":"https://www.tiktok.com/@loca.chelsey/video/6815724666934676742"}]}}},"statusCode":0,"errMsg":null}
                            baseActivity.dismissMarker()
                            baseActivity.showToast("Not Support!")
                        }

                    },
                    {
                        baseActivity.showToast("Error!")
                        baseActivity.dismissMarker()
                    })
            )
    }

}